import request from '@/utils/request'

/* 获取月卡接口 */
export const fetchCardListAPI = (pageParams) => {
  return request({
    url: '/parking/card/list',
    method: 'GET',
    params: pageParams
  })
}

/* 删除月卡的接口 */
export const deleteCardAPI = (id) => {
  return request({
    url: `/parking/card/${id}`,
    method: 'DELETE'
  })
}

/* 添加月卡的接口 */
export const addCardAPI = (data) => {
  return request({
    url: '/parking/card',
    method: 'POST',
    data
  })
}

/* 编辑月卡的接口 */
export const editCardAPI = (data) => {
  return request({
    url: '/parking/card/edit',
    method: 'PUT',
    data
  })
}

/* 续费月卡的接口 */
export const renewCardAPI = (data) => {
  return request({
    url: '/parking/card/recharge',
    method: 'POST',
    data
  })
}

/* 查找月卡的接口 */
export const findCardAPI = (id) => {
  return request({
    url: `/parking/card/detail/${id}`,
    method: 'get'
  })
}

/* 查看月卡详情的接口 */
export const fetchCardDetailAPI = (id) => {
  return request({
    url: `/parking/card/${id}`,
    method: 'GET'
  })
}

